import Vue from 'vue'
import Vuex from 'vuex'
import vuexPersist from "vuex-persist";
Vue.use(Vuex)
export default new Vuex.Store({
  state: {
    CategoryId: 0,
    classTitle: "",
    ids: 0,
    shows: "",
    ShowHidden: false,
    mobiles: ""
  },
  mutations: {
    ClassifyId(state, id) {
      state.CategoryId = id;
      console.log("分类:id", state.CategoryId);
    },
    ClassifyName(state, title) {
      state.classTitle = title;
    },
    isid(state, id) {//tab切换id
      state.ids = id;
      console.log("tab切换id", state.ids);
    },
    // ishow(state, show) {
    //   state.shows = show;
    //   console.log(state.shows);
    // },
    // onshow(state) {
    //   state.ShowHidden = !state.ShowHidden;
    //   console.log(state.ShowHidden);
    // },
    onmobile(state, mobile) {
      state.mobiles = mobile;
      console.log(state.mobiles);
    }
  },
  actions: {
  },
  modules: {
  },
  plugins: [
    new vuexPersist({
      storage: window.localStorage,
    }).plugin,
  ],
})
